package com.miyake.dsp.osa.lab;

public class AutoSetting {

	public int getAverageCount() {
		return averageCount;
	}

	public void setAverageCount(int averageCount) {
		this.averageCount = averageCount;
	}

	public double getAttenuator() {
		return attenuator;
	}

	public void setAttenuator(double attenuator) {
		this.attenuator = attenuator;
	}

	public double getBandwidth() {
		return bandwidth;
	}

	public void setBandwidth(double bandwidth) {
		this.bandwidth = bandwidth;
	}

	public RunMode getRunMode() {
		return runMode;
	}

	public void setRunMode(RunMode runMode) {
		this.runMode = runMode;
	}

	public enum RunMode {
		Auto, Manual
	};
	
	public int getDistanceRange() {
		return distanceRange;
	}

	public void setDistanceRange(int distanceRange) {
		this.distanceRange = distanceRange;
	}

	public int getPulseWidth() {
		return pulseWidth;
	}

	public void setPulseWidth(int pulseWidth) {
		this.pulseWidth = pulseWidth;
	}

	public int getInterval() {
		return interval;
	}

	public void setInterval(int interval) {
		this.interval = interval;
	}

	public boolean isStop() {
		return stop;
	}

	public void setStop(boolean stop) {
		this.stop = stop;
	}

	public interface AutoSettingHandler {
		public boolean isReady();
		public void resetReady();
	}
	private AutoSettingHandler handler;
	private boolean stop;
	private boolean initial;
	
	@LabUiAnnotation(caption="Interval [ms]")
	private int interval = 1000;
	
	@LabUiAnnotation(caption="Distance Range [km]")
	private int distanceRange = 10;

	@LabUiAnnotation(caption="Pulse Width [ns]")
	private int pulseWidth = 100;	

	@LabUiAnnotation(caption="Attenuator [dB]")
	private double attenuator = 0;

	@LabUiAnnotation(caption="Bandwidth [Hz]")
	private double bandwidth = 1e6;
	
	@LabUiAnnotation(caption="Average Count")
	private int averageCount = 1;
	
	@LabUiAnnotation(caption="Run Mode")
	private RunMode runMode = RunMode.Auto;
	
	public void setAutoSettingHandler(AutoSettingHandler handler) {
		this.handler = handler;
	}
	
	public boolean isReady() {
		return handler.isReady();
	}

	public void resetReady() {
		handler.resetReady();
	}

	public boolean isInitial() {
		return initial;
	}
	
	public void setInitial(boolean initial) {
		this.initial = initial;
	}
}
